package com.whys;

public class Person {
    // 1.私有化成员变量
    private String name;
    private String gender;
    private String age;


    // 3. 创建有参构造和无参构造

    public Person(){};

    public Person(String name, String gender, String age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }


    //2. 调用get 和 set 方法
    //alt + insert

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    // 方法

    public void like(){
        System.out.println(this.name+" "+this.age + "爱好打篮球");
    }





}
